﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Waiter.View
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            tab1.Controls.Add(item1);
            this.tabControl1.Controls.Add(tab1);
        }

        TabPage tab1 = new TabPage();
        UserControl1 item1 = new UserControl1();

        TabPage tab2 = null;
        UserControl1 item2 = null;

        private void button1_Click(object sender, EventArgs e)
        {
            tab1.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {

                
            if (!tabControl1.Contains(tab2))
            {
                tab2 = new TabPage();
                item2 = new UserControl1();
                tab2.Controls.Add(item2);
                this.tabControl1.Controls.Add(tab2);
            }
            this.tabControl1.SelectedTab = tab2;
        }
    }
}
